from typing import Optional, List
from pydantic import BaseModel

class AIProjectBase(BaseModel):
    name: str
    type: str
    difficulty: int
    description: Optional[str] = None
    github_url: Optional[str] = None
    demo_url: Optional[str] = None
    technologies: Optional[str] = None
    tags: Optional[str] = None

class AIProjectCreate(AIProjectBase):
    user_id: int
    family_id: int

class AIProjectUpdate(AIProjectBase):
    id: int
    stars: Optional[int] = None
    views: Optional[int] = None

class AIProjectInDB(AIProjectBase):
    id: int
    user_id: int
    family_id: int
    stars: int
    views: int
    created_at: str
    updated_at: str
    
    class Config:
        orm_mode = True